﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.views.components {
    import reprise.ui.*;
    import flash.display.*;
    import net.wooga.pets.views.popups.*;
    import net.wooga.pets.views.components.mainmenu.*;
    import net.wooga.pets.views.*;
    import net.wooga.pets.views.world.*;
    import net.wooga.pets.views.fountain.*;
    import net.wooga.pets.constants.*;
    import net.wooga.pets.utils.*;
    import net.wooga.pets.views.collections.*;

    public class MainView extends UIComponent {

        private const ALWAYS_PLACE_PET_ON_LEVEL_0_OF_DPLIST:int = 0;

		[Inject]
        public var _hospitalView:HospitalView;
        public var _metaMenuDisplay:UIComponent;
        public var _basementDisplay:BasementDisplay;
        private var _customizeView:CustomizeView;
        private var _constructionSite:ConstructionSite;
        private var _mainMenuDisplay:UIComponent;
        private var _popupView:PopupContainerView;
        private var _systemMessageView:SystemMessageView;
        private var _frontBubbleView:FrontBubbleView;
        private var _truckView:TruckView;

        public static const className:String = "MainMenu";

        public function MainView(){
            this._customizeView = new CustomizeView();
            super();
        }
        public function createAvatarView(_arg1:String, _arg2:String, _arg3:Boolean=true):AvatarView{
            var _local4:AvatarView;
            _local4 = new AvatarView(_arg1, _arg2);
            _local4.visible = _arg3;
            this._hospitalView.avatarDisplay.addChild(_local4);
            return (_local4);
        }
        public function createPatientView(_arg1:String, _arg2:String, _arg3:Boolean=true):PatientView{
            var _local4:PatientView = new PatientView(_arg1, _arg2);
            _local4.visible = _arg3;
            var _local5:DisplayObjectContainer = (this._hospitalView.petsDisplay as DisplayObjectContainer);
            _local5.addChildAt(_local4, this.ALWAYS_PLACE_PET_ON_LEVEL_0_OF_DPLIST);
            return (_local4);
        }
        public function createWaitingPetView(_arg1:String, _arg2:String, _arg3:Boolean=true):void{
            var _local4:WaitingPetView = new WaitingPetView(_arg1, _arg2);
            _local4.visible = _arg3;
            var _local5:DisplayObjectContainer = (this._hospitalView.waitingPetsDisplay as DisplayObjectContainer);
            _local5.addChildAt(_local4, this.ALWAYS_PLACE_PET_ON_LEVEL_0_OF_DPLIST);
        }
        public function createBabyView(_arg1:String, _arg2:String, _arg3:Boolean=true):void{
            var _local4:BabyView;
            _local4 = new BabyView(_arg1, _arg2);
            _local4.visible = _arg3;
            var _local5:DisplayObjectContainer = (this._hospitalView.petsDisplay as DisplayObjectContainer);
            _local5.addChildAt(_local4, this.ALWAYS_PLACE_PET_ON_LEVEL_0_OF_DPLIST);
        }
        public function createRoomView(_arg1:String, _arg2:String, _arg3:Boolean, _arg4:Boolean):RoomView{
            var _local5:RoomView = new RoomView(_arg1, 0, 0, _arg2);
            _local5.visible = _arg3;
            _local5.isBuildMode = _arg4;
            this._hospitalView.hospitalDisplay.addChild(_local5);
            return (_local5);
        }
        public function placeDummyRoom(_arg1:MovieClip):void{
            this._hospitalView.hospitalDisplay.addChild(_arg1);
        }
        public function removeDummyRoom(_arg1:String):void{
            Displays.removeChildByName(this._hospitalView.hospitalDisplay, _arg1);
        }
        public function createDoctorView(_arg1:String, _arg2:String, _arg3:Boolean=true):DoctorView{
            var _local4:DoctorView = new DoctorView(_arg1, _arg2);
            _local4.visible = _arg3;
            this._hospitalView.doctorsDisplay.addChild(_local4);
            return (_local4);
        }
        public function createRoofDisplay(_arg1:String, _arg2:Number, _arg3:Number, _arg4:String):RoofDisplay{
            var _local5:RoofDisplay = new RoofDisplay(_arg1, _arg2, _arg3, _arg4);
            this._hospitalView.hospitalDisplay.addChild(_local5);
            return (_local5);
        }
        public function handlePatient(_arg1:Boolean, _arg2:DisplayObject):void{
            var _local3:DisplayObjectContainer = (this._hospitalView.petsDisplay as DisplayObjectContainer);
            if (_arg1){
                _local3.addChild(_arg2);
            } else {
                _local3.removeChild(_arg2);
            };
        }
        public function createMainMenu():void{
            this._mainMenuDisplay.addChild(new MainMenu());
        }
        public function createMetaMenu():void{
            this._metaMenuDisplay.addChild(new MetaMenu());
        }
        public function createCollectionStatus():void{
            addChild(new CollectionStatusDisplay());
        }
        public function createElevatorShaft(_arg1:String, _arg2:Number, _arg3:Number, _arg4:String, _arg5:Boolean=false):ElevatorShaftDisplay{
            var _local6:ElevatorShaftDisplay = new ElevatorShaftDisplay(_arg1, _arg2, _arg3, _arg4);
            if (_arg5){
                _local6.showfrontWall();
            };
            this._hospitalView.hospitalDisplay.addChild(_local6);
            return (_local6);
        }
        public function createConstructionSite():void{
            this._constructionSite = new ConstructionSite();
            this._hospitalView.hospitalDisplay.addChild(this._constructionSite);
        }
        public function createElevatorRoof(_arg1:String, _arg2:Number, _arg3:Number, _arg4:String):ElevatorRoofDisplay{
            return (ElevatorRoofDisplay(this._hospitalView.hospitalDisplay.addChild(new ElevatorRoofDisplay(_arg1, _arg2, _arg3, _arg4))));
        }
        public function createBasement(_arg1:String, _arg2:Number, _arg3:Number, _arg4:String):BasementDisplay{
            this._basementDisplay = BasementDisplay(this._hospitalView.hospitalDisplay.addChild(new BasementDisplay(_arg1, _arg2, _arg3, _arg4)));
            return (this._basementDisplay);
        }
        public function createIntersol(_arg1:String, _arg2:Number, _arg3:Number, _arg4:String):IntersolDisplay{
            return (IntersolDisplay(this._hospitalView.hospitalDisplay.addChild(new IntersolDisplay(_arg1, _arg2, _arg3, _arg4))));
        }
        override protected function initialize():void{
            super.initialize();
            cssID = "mainView";
        }
        override protected function createChildren():void{
            var _local1:GameView = new GameView();
            addChildAt(_local1, 0);
            var _local2:GameBackground = new GameBackground("background", 0, 0, GameConstants.BACKGROUND, m_rootElement);
            _local1.addBackground(_local2);
            this.createVillage(_local2);
            this.createBanner(_local2);
            this.createTree(_local2);
            this._truckView = new TruckView();
            _local1.addTruck(this._truckView);
            this._hospitalView = new HospitalView();
            _local1.addHospital(this._hospitalView);
            this._mainMenuDisplay = addComponent("menuDisplay");
            this._metaMenuDisplay = addComponent("metaMenuDisplay");
            addChild(this._customizeView);
            this._frontBubbleView = new FrontBubbleView();
            _local1.vectorDisplay.addChild(this._frontBubbleView);
            this._systemMessageView = new SystemMessageView();
            addChild(this._systemMessageView);
            this._popupView = new PopupContainerView();
            addChild(this._popupView);
            addChild(new VisitFriendTransition());
        }
        private function createBanner(_arg1:Sprite):void{
            _arg1.addChild(new Banner(GameConstants.BANNER, 264, 284, GameConstants.BANNER));
        }
        public function showSystemMessage(_arg1:String):void{
            this._systemMessageView.visible = true;
            this._systemMessageView.message = _arg1;
        }
        protected function createVillage(_arg1:Sprite):void{
            _arg1.addChild(new Village(GameConstants.VILLAGE, 388, 198, GameConstants.VILLAGE));
        }
        protected function createTree(_arg1:Sprite):void{
            var _local2:TreeView = new TreeView(GameConstants.TREE, 1088, 295);
            _arg1.addChild(_local2);
        }

    }
}//package net.wooga.pets.views.components 
